import { API_HOST, API_HOST_10443 } from 'config'
import request from 'request'

import user from './user'
import mall from './mall'
import contract from './contract'

export default {

  ...user,
  ...mall,
  ...contract,

  getHotSearch(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/config/indexHotSearch",
      data: data,
      showLoading: false,
      showErrToast: false
    });
  },

  getFourCircle(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/config/indexFourCircle",
      data: data,
      showLoading: false,
      showErrToast: false
    });
  },

  getTwoCol(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/config/indexTwo",
      data: data,
      showLoading: false,
      showErrToast: false
    });
  },

  getIndexVideo(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/config/indexVideo",
      data: data,
      showLoading: false,
      showErrToast: false
    });
  },

  getIndexBg(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/config/indexBg",
      data: data,
      showLoading: false,
      showErrToast: false
    });
  },

  getGiftBagDetail(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/coupon/rowDetail",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      showLoading: true,
      showErrToast: true
    });
  },

  getPopWindow() {
    return request({
      url: API_HOST_10443 + "wx/config/pop",
      showLoading: false,
      showErrToast: false
    });
  },

  userConfirmCoupon(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/coupon/userConfirmCoupon",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      method: "POST",
      showLoading: true,
      showErrToast: true
    });
  },

  confirmCoupon(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/coupon/confirmCoupon",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      method: "POST",
      showLoading: true,
      showErrToast: true
    });
  },

  completeCouponRefund(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/coupon/completeCouponRefund",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      method: "POST",
      showLoading: true,
      showErrToast: true
    });
  },

  getshopreceivecouponlist(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/coupon/shopReceivelist",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      method: "POST",
      showLoading: true,
      showErrToast: true
    });
  },

  applyCouponRefund(data={}){
    return request({
      url: API_HOST_10443 + "wx/coupon/applyCouponRefund",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      method: "POST",
      showLoading: true,
      showErrToast: true
    });
  },

  /** 用户申请使用优惠券 */
  applyCouponUse(data={}){
    return request({
      url: API_HOST_10443 + "wx/coupon/applyCouponUse",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      method: "POST",
      showLoading: true,
      showErrToast: true
    });
  },

  payCouponOrder(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/coupon/payCouponOrder",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      method: "POST",
      showLoading: true,
      showErrToast: true
    });
  },

  getCouponOrder(data={}){
    return request({
      url: API_HOST_10443 + "wx/coupon/getCouponOrder",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      method: "POST",
      showLoading: true,
      showErrToast: true
    });
  },

  getuserrelationshop(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/shop/getUserRelationPayShop",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      method: "POST",
      showLoading: false,
      showErrToast: false
    });
  },

  getshoplist(data={}){
    return request({
      url: API_HOST_10443 + "wx/shop/getPayShop",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      method: "POST",
      showLoading: true,
      showErrToast: true
    });
  },

  getusercouponlist(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/coupon/usergetlist",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      method: "POST",
      showLoading: true,
      showErrToast: true
    });
  },

  getusercoupondetail(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/coupon/getUserCouponDetail",
      data: data,
      showLoading: true,
      showErrToast: true
    });
  },

  useraddfreecoupon(data={}){
    return request({
      url: API_HOST_10443 + "wx/coupon/getFreeCoupon",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      method: "POST",
      showLoading: true,
      showErrToast: true
    });
  },

  getcoupondetail(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/coupon/detail",
      data: data,
      showLoading: true,
      showErrToast: true
    });
  },

  getcouponlist(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/coupon/rows",
      data: data,
      showLoading: true,
      showErrToast: true
    });
  },

  getcouponcanuseshop(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/coupon/canUseShops",
      data: data,
      showLoading: false,
      showErrToast: false
    });
  },

  getbanner(data = {}){
    return request({
      url: API_HOST_10443 + "wx/banner/list",
      data: data,
      showLoading: false,
      showErrToast: false
    });
  },

  getproductdetail(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/product/getProductInfo",
      data: data,
      showLoading: true,
      showErrToast: true
    });
  },

  getproductlist(data = {}){
    return request({
      url: API_HOST_10443 + "wx/product/getProductByType",
      data: data,
      showLoading: true,
      showErrToast: true
    });
  },

  getshopreceiveorderlist(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/order/getShopReceiveOrder",
      data: data,
      showLoading: true,
      showErrToast: true
    });
  },

  getuserorder(data = {}){
    return request({
      url: API_HOST_10443 + "wx/order/getUserOrder",
      data: data,
      showLoading: true,
      showErrToast: true
    });
  },
//wx/order/testProductOrder
  getProductOrder(data = {}){
    return request({
      url: API_HOST_10443 + "wx/order/getProductOrder",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded'},
      method: "POST",
      showLoading: true,
      showErrToast: true
    });
  },

  getProductOrder20200907(data = {}) {
    return request({
      url: API_HOST_10443 + "wx/order/getProductOrder20200907",
      data: data,
      method: "POST",
      showLoading: true,
      showErrToast: true
    });
  },

  orderCancel(data = {}) {
    return request({
      url: API_HOST_10443 + "/wx/quantity/orderFail",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded'},
      method: "GET",
      showLoading: false,
      showErrToast: false
    });
  },

  getliveplaylist(data = {}) {
    return request({
      url: API_HOST + "wx/liveplay/list.asp",
      data: data,
      showLoading: true,
      showErrToast: true
    }); 
  },

  getareadata(data = {}) {
    return request({
      url: API_HOST + "statisticsuserareanew.asp",
      data: data,
      showLoading: true,
      showErrToast: false
    });    
  },

  getmycustomer(data = {}) {
    return request({
      url: API_HOST + "getcustormer.asp",
      data: data,
      showLoading: true,
      showErrToast: false
    });
  },

  getUser(data = {}) {
    return request({
      url: API_HOST + "getuser.asp",
      data: data,
      showLoading: true,
      showErrToast: false
    });
  },

  initUser(data = {}) {
    return request({
      url: API_HOST + "inituser.asp",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      method: "POST",
      showLoading: false,
      showErrToast: false
    });
  },

  saveUser(data = {}) {
    return request({
      url: API_HOST + "saveuser.asp",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      method: "POST",
      showLoading: false,
      showErrToast: false
    });
  },

  getQr(data = {}) {
    return request({
      url: API_HOST + "getqr.asp",
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      method: "POST",
      showLoading: false,
      showErrToast: false
    });
  },

  getActivityDetail(data = {}) {
    return request({
      url: API_HOST + "activitydetail.asp",
      data: data,
      showLoading: true,
      showErrToast: false
    });
  }

}
